import Vue from 'vue'
import VueRouter from 'vue-router'


Vue.use(VueRouter)

const routes = [
{
    path: '/',
    redirect: '/login',
},
{
    path: '/login',     //登录
    name: 'login',
    component: () => import('../views/login/idnex.vue')
},
{
    path: '/home',      //首页
    name: 'home',
    meta: {title: '首页'},
    component: () => import('../views/home/idnex.vue'),
    children: [
        {
            path: '/idnex',     //首页
            name: 'idnex',
            meta: {title: '首页'},
            component: () => import('../views/home/idnex/idnex.vue')
        },
        {
            path: '/user',     //用户管理
            name: 'user',
            meta: {title: '用户管理'},
            component: () => import('../views/home/user/idnex.vue')
        },
        {
            path: '/order',     //订单管理
            name: 'order',
            meta: {title: '订单管理'},
            component: () => import('../views/home/order/idnex.vue'),
            children: [
                {
                    path: '/order/infor',
                    name: 'infor',
                    meta: {title: '订单信息'},
                    component: () => import('../views/home/order/infor.vue'),
                }
            ]
        }
    ]
},
]

const router = new VueRouter({
  routes
})

export default router
